<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>${fns:getConfig('productName')}</title>
<%@include file="/WEB-INF/views/include/dialog.jsp"%>
<meta name="decorator" content="default" />
<style type="text/css">
#main {
	padding: 0;
	margin: 0;
}

#main .container-fluid {
	padding: 0 7px 0 10px;
}

#header {
	margin: 0 0 10px;
	position: static;
}

#header li {
	font-size: 14px;
	_font-size: 12px;
}

#header .brand {
	font-family: Helvetica, Georgia, Arial, sans-serif, 黑体;
	font-size: 26px;
	padding-left: 33px;
}

#footer {
	margin: 8px 0 0 0;
	padding: 3px 0 0 0;
	font-size: 11px;
	text-align: center;
	border-top: 2px solid #0663A2;
}

#footer, #footer a {
	color: #999;
}
</style>
<script type="text/javascript">
	$(document).ready(function() {
		$("#menu a.menu").click(function() {
			$("#menu li.menu").removeClass("active");
			$(this).parent().addClass("active");
			if (!$("#openClose").hasClass("close")) {
				$("#openClose").click();
			}
		});
		// 获取通知数目  <c:set var="oaNotifyRemindInterval" value="${fns:getConfig('oa.notify.remind.interval')}"/>
		function getNotifyNum(){
		     $.get("${ctx}/sys/notify/self/count?updateSession=0&t="+new Date().getTime(),function(data){
				var num = parseFloat(data);
				if (num > 0){
					$("#notifyNum,#notifyNum2").show().html("("+num+")");
				}else{
					$("#notifyNum,#notifyNum2").hide()
				}
			}); 
		}
		getNotifyNum(); 
		setInterval(getNotifyNum, 60000); 

	});
</script>
</head>
<body>
	<div id="main">
		<div id="header" class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="brand">${fns:getConfig('productName')}</div>
				<div class="nav-collapse">
					<ul id="menu" class="nav">
						<c:set var="firstMenu" value="true" />
						<c:forEach items="${fns:getMenuList()}" var="menu"
							varStatus="idxStatus">
							<!-- 1是顶级菜单不显示，二级菜单才会显示 -->
							<c:if test="${menu.parent.id eq 1 && menu.isShow eq 1}">
								<li class="menu ${firstMenu?' active':''}"><a class="menu"
									href="${ctx}/sys/menu/tree?parentId=${menu.id}"
									target="menuFrame">${menu.name}</a></li>
								<c:if test="${firstMenu}">
									<c:set var="firstMenuId" value="${menu.id}" />
								</c:if>
								<c:set var="firstMenu" value="false" />
							</c:if>
						</c:forEach>
					</ul>
					<ul class="nav pull-right">
						<li class="dropdown"><a class="dropdown-toggle"
							data-toggle="dropdown" href="#" title="个人信息">您好,<shiro:principal
									property="name" />&nbsp;<span id="notifyNum"
								class="label label-info hide"></span></a>
							<ul class="dropdown-menu">
								<li><a href="${ctx}/sys/user/info" target="mainFrame"><i
										class="icon-user"></i>&nbsp; 个人信息</a></li>
								<li><a href="${ctx}/sys/user/modifyPwd" target="mainFrame"><i
										class="icon-lock"></i>&nbsp; 修改密码</a></li>
								<li><a href="${ctx}/sys/notify/self" target="mainFrame"><i
										class="icon-bell"></i>&nbsp; 我的通知 <span id="notifyNum2"
										class="label label-info hide"></span></a></li>
							</ul></li>
						<li><a href="${ctx}/logout" title="退出登录">退出</a></li>
						<li>&nbsp;</li>
					</ul>
				</div>
				<!--/.nav-collapse -->
			</div>
		</div>
		<div class="container-fluid">
			<div id="content" class="row-fluid">
				<div id="left">
					<iframe id="menuFrame" name="menuFrame"
						src="${ctx}/sys/menu/tree?parentId=${firstMenuId}"
						style="overflow: visible;" scrolling="yes" frameborder="no"
						width="100%" height="650"></iframe>
				</div>
				<div id="openClose" class="close">&nbsp;</div>
				<div id="right">
					<iframe id="mainFrame" name="mainFrame" src=""
						style="overflow: visible;" scrolling="yes" frameborder="no"
						width="100%" height="650"></iframe>
				</div>
			</div>
			<div id="footer" class="row-fluid">
				Copyright &copy; 2017-${fns:getConfig('copyrightYear')}
				${fns:getConfig('productName')} - Powered By <a
					href="http://www.fanrenqiji.com" target="_blank">凡人奇迹 </a>${fns:getConfig('version')}
			</div>
		</div>
	</div>
	<script type="text/javascript">
		var leftWidth = "160"; // 左侧窗口大小
		function wSize() {
			var minHeight = 500, minWidth = 980;
			var strs = getWindowSize().toString().split(",");
			$("#menuFrame, #mainFrame, #openClose").height(
					(strs[0] < minHeight ? minHeight : strs[0])
							- $("#header").height() - $("#footer").height()
							- 32);
			$("#openClose").height($("#openClose").height() - 5);
			if (strs[1] < minWidth) {
				$("#main").css("width", minWidth - 10);
				$("html,body").css({
					"overflow" : "auto",
					"overflow-x" : "auto",
					"overflow-y" : "auto"
				});
			} else {
				$("#main").css("width", "auto");
				$("html,body").css({
					"overflow" : "hidden",
					"overflow-x" : "hidden",
					"overflow-y" : "hidden"
				});
			}
			$("#right").width(
					$("#content").width() - $("#left").width()
							- $("#openClose").width() - 5);
		}
	</script>
	<script src="${ctxStatic}/common/wsize.min.js" type="text/javascript"></script>
</body>
</html>